<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改客户')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-erpCustomer-edit" th:object="${erpCustomer}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">客户编号：</label>
                <div class="col-sm-8">
                    <input name="customerNo" th:field="*{customerNo}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">客户名称：</label>
                <div class="col-sm-8">
                    <input name="companyName" th:field="*{companyName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">联系人：</label>
                <div class="col-sm-8">
                    <input name="contacts" th:field="*{contacts}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">联系电话：</label>
                <div class="col-sm-8">
                    <input name="contactsPhone" th:field="*{contactsPhone}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">联系地址：</label>
                <div class="col-sm-8">
                    <input name="contactsAddress" th:field="*{contactsAddress}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">常用生产型号集：</label>
                <div class="col-sm-8">
                    <textarea name="modeNoList" class="form-control">[[*{modeNoList}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">常用收货地址ID集：</label>
                <div class="col-sm-8">
                    <textarea name="consigneeIdList" class="form-control">[[*{consigneeIdList}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        // 详情禁用所有input
        $(":input").attr("disabled", "disabled");

        var prefix = ctx + "erp/erpCustomer";
        $("#form-erpCustomer-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-erpCustomer-edit').serialize());
            }
        }
    </script>
</body>
</html>